package com.xgpro.common.config;


import com.xgpro.common.utils.ReadPropertiesUtil;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * @author tx
 * @version 1.0
 * @date 2019/8/23 22:22
 */
public class MailAuthenticator extends Authenticator {
    /**
     * 邮箱用户名
     */
    public static String USERNAME = ReadPropertiesUtil.readUrl("mail_username");
    /**
     * 邮箱授权码
     */
    public static String CODE = ReadPropertiesUtil.readUrl("mail_code");

    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(USERNAME, CODE);
    }

}
